package com.pattern.behavior.responsibilitychain;

public class Client {
    public static void main(String[] args) {
        ResponsibilityProcessor aProc, bProc, otherProc;
        aProc = new ARProcessor();
        bProc = new BRProcessor();
        otherProc = new OtherRProcessor();

        // construct the chain
        aProc.setProcessor(bProc);
        bProc.setProcessor(otherProc);

        aProc.processRequest("a");
        aProc.processRequest("b");

        //--random to judge the chain of the responsibility whether is pure.------------------------
        System.out.println("--random to judge the chain of the responsibility whether is pure.--");
        aProc.processRequest("C");
        aProc.processRequest("C");
        aProc.processRequest("C");
    }

}
